package com.jobpass.common.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jobpass.common.insterface.AdminMapper;
import com.jobpass.common.model.Admin;
import com.jobpass.common.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {

    @Resource
    private AdminMapper adminMapper;


    @Override
    public List<Admin> FindAllAdmin() {
        return adminMapper.selectList(null);
    }

    @Override
    public Admin FindAdminById(Long id) {
        return adminMapper.selectById(id);
    }

    @Override
    public int DeleteAdminById(Long id) {
        return adminMapper.deleteById(id);
    }

    @Override
    public int UpdateAdminById(Admin admin) {
        return adminMapper.updateById(admin);
    }

    @Override
    public int SavaAdmin(Admin admin) {
        return adminMapper.insert(admin);
    }
}
